<?php 
header("Content-type:text/html;charset=utf-8");
//接受前端数据
//$userName声明 $_POST["userName"]

$userName = $_POST["userName"];
$password = $_POST["password"];
//建立连接
$conn = mysql_connect("localhost","root","root");
//选择数据库
mysql_select_db("dome");
//查询
//username数据库名 
$result=mysql_query("select * from user where

username='$userName' and password='$password'",$conn);

//获得查找行数
$rows=mysql_num_rows($result);
//返回数据
if($rows>0){
    echo "success";
}
else{
    echo "erro";
}
//关闭数据库
mysql_close($conn);

?>